e[Single]
#ScriptVersion[2]
#Title[Sʏ1]

script_enemy_main{
	
	@Initialize{
		//f[^
		InitializeData();
		InitializeAction();
		
		//Ctݒ
		SetLife( 2500 );
		//ʒuݒ
		Warp( CenterX, MinY + 100, 40 );
		//_[W[gݒ
		SetDamageRate( 100, 100 );
		//蔻ݒ
		SetCollisionEx( 32, 16, false, 60 );
		//Gl~[}[J[
		SetEnemyMarker( true );
		
		//C^XNJn
		TMain();
	}
	
	@MainLoop{
		//yield[v
		yield;
	}
	
	@DrawLoop{
		//{X摜`
		SetGraphicScale( xscale, yscale );
		DrawBoss( imgBoss );
	}
	
	@Finalize{
		//ŏI
		FinalizeData();
	}
	
	/**
	 * C^XN
	 */
	task TMain(){
		//60F(1b)҂
		FWait( 60 );
		
		//Ԑݒ
		SetTimer( 32 );
		
		//U
		alternative( difficult )
			case( "Easy" ){
				Atack_Easy();
			}
			case( "Normal" ){
				Atack_Normal();
			}
			case( "Panic" ){
				Atack_Panic();
			}
	}
	
	/**
	 * Easy UC^XN
	 */
	task Atack_Easy(){
	}
	
	/**
	 * Normal UC^XN
	 */
	task Atack_Normal(){
	}
	
	/**
	 * Panic UC^XN
	 */
	task Atack_Panic(){
		loop{
			Atack1();
			FWait( 130 );
			Warp( rand( MinX + 32, MaxX - 32 ), MinY + 100 + rand( -20, 20 ), 40 );
			FWait( 60 );
		}
	}
	
	/**
	 * e^XN1
	 */
	task Atack1(){
		let rad = 0;
		let x1 = GetX();
		let y1 = GetY();
		let x2 = GetX();
		let y2 = GetY();
		let angle1 = 90;
		let angle2 = 90;
		let px = GetPlayerX();
		let py = GetPlayerY();
		let count = 0;
		
		loop( 120 ){
			x1 = GetGapX( GetX(), rad, angle1 );
			y1 = GetGapY( GetY(), rad, angle1 );
			x2 = GetGapX( GetX(), rad, angle2 );
			y2 = GetGapY( GetY(), rad, angle2 );
			
			CreateShot02( x1, y1, 0.6, angle1 - 80, 0.03, 2.2, US_BALL_F_RED , 12 );
			CreateShot02( x2, y2, 0.6, angle2 + 80, 0.03, 2.2, US_BALL_F_BLUE, 12 );
			
			CreateShot02( x1, y1, 0.8, angle1 - 160, 0.028, 2.6, US_BALL_F_RED , 12 );
			CreateShot02( x2, y2, 0.8, angle2 + 160, 0.028, 2.6, US_BALL_F_BLUE, 12 );
			
			CreateShot02( x1, y1, 1.0, angle1 - 240, 0.026, 3.2, US_BALL_F_RED , 12 );
			CreateShot02( x2, y2, 1.0, angle2 + 240, 0.026, 3.2, US_BALL_F_BLUE, 12 );
			
			ascent(i in 0..5){
				CreateShot01( x1, y1, 4.6, GetGapAngle( x1, y1, px, py ) + ( i - 2 ) * 24, PURPLE23, 12 );
				CreateShot01( x2, y2, 4.6, GetGapAngle( x2, y2, px, py ) + ( i - 2 ) * 24, PURPLE23, 12 );
			}
			
			rad += 1.4;
			angle1 += 7.4;
			angle2 -= 7.4;
			count += 1;
			
			yield;
		}
	}
	
	//XNvg̃CN[h
	#include_function ".\initialize.txt"
}